import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/views/Login.vue'
import Home from '@/views/Home.vue'
import Index from '@/components/Index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      children:[
        {
          path: '/',
          name: 'index',
          component: Index
        },
        {
          path: '/game',
          name: 'game',
          component: ()=>import('@/components/Game.vue')
        },
        {
          path: '/gameAi',
          name: 'gameAi',
          component: ()=>import('@/components/GameAI.vue')
        },
        {
          path: '/gamePerson',
          name: 'gamePerson',
          component: ()=>import('@/components/GamePerson.vue')
        },
        {
          path: '/gameWatch',
          name: 'gameWatch',
          component: ()=>import('@/components/GameWatch.vue')
        }
      ]
    },
    {
      path: '/home',
      redirect: '/'
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    }
  ]
})

export default router
